/*
我的多线程测试
 */
#include <stdio.h>
#include <stdlib.h>
#include <threads.h>


int mytask(int id) {
	for (int i = 0; i < 10; i++)
	{
		printf("%d - 这是我的任务进程%d.\n",id,(i+1));
		thrd_sleep(&(struct timespec) {  .tv_sec = 0  ,.tv_nsec=500*1000000L }, NULL);
	}
	
	return 0;
}

int main5() {

	thrd_t th1;
	thrd_t th2;

	thrd_create(&th1, mytask, 1);
	thrd_create(&th2, mytask, 2);
	thrd_join(th1, NULL);
	thrd_join(th2, NULL);


	printf("main结束..\n");

	return 0;
}

